<template>
  <div class="list">
    <div>通道状态：<span :class="enter_status === -200 || enter_status === -100 || enter_status === -110 || enter_status === 313 || enter_status === 913 ? 'err' : enter_status === 200 || enter_status === 500 ? 'succ' : 'tip'">
      {{ enter_status === -200 ? '审核未通过' : enter_status === -100 ? '入驻失败' : enter_status ===  0 ? '资料提审' : enter_status === 101 ? '已初审，待入驻' : enter_status === 100 ? '入驻中' : enter_status === -110 ? '入驻失败' : enter_status === 200 ? '已入驻' : enter_status === 311 ? '等待配置支付通道' : enter_status === 312 ? '部分支付通道配置成功' : enter_status === 313 ? '支付通道配置失败' : enter_status === 310 ? '支付通道配置成功' : enter_status === 500 ? '完成' : enter_status === 900 ? '申请修改信息' : enter_status === 901 ? '信息修改中' : enter_status === 910 ? '申请修改费率' : enter_status === 911 ? '费率修改中' : enter_status === 912 ? '费率修改完成' : enter_status === 913 ? '费率修改失败' : '无' }}</span></div>
    <div>联系地址：{{ model.area }}</div>
    <div>详细地址：<span>{{ model.address }}</span></div>
    <div>经营类目：<span>{{ model.industry }}</span></div>
    <div>蓝海行动：<span>{{ model.is_blue ? '已参加' : '未参加' }}</span></div>
    <div>渠道选择：<span>{{ model.balance_type }}</span></div>
    <div>短信验证：<span>已验证</span></div>
    <div>微信费率：<span>{{ model.wx_rate }}%</span></div>
    <div>支付宝费率：<span>{{ model.ali_rate }}%</span></div>
  </div>
</template>

<script>
import { merchantWsGetInfo } from '@/api/salesman'

export default {
  name: 'channelList',
  data() {
    return {
      enter_status: '',
      model: {
        area: '',
        address: '',
        industry: '',
        is_blue: true,
        balance_type: 'D1',
        code: '',
        wx_rate: '',
        ali_rate: ''
      }
    }
  },
  created() {
    merchantWsGetInfo(this.$route.query.merchant_num).then(res => {
      if (res.data.errorCode === 0) {
        this.model.area = res.data.result.area.name.toString()
        this.model.address = res.data.result.address
        this.model.industry = res.data.result.industry.name
        this.model.is_blue = res.data.result.is_blue
        this.model.balance_type = res.data.result.balance_type
        this.model.ali_rate = Number(res.data.result.ali_rate)
        this.model.wx_rate = Number(res.data.result.wx_rate)
        this.enter_status = res.data.result.enter_status.code
      } else {
        this.$weui.alert(res.data.errorMsg)
      }
    })
  }
}
</script>


<style lang="scss" scoped>
  @import '@/styles/index.scss';
  .list {
    width: px2rem(670px);
    min-height: px2rem(640px);
    background:rgba(255,255,255,1);
    box-shadow:0px 0px px2rem(15px) rgba(188,188,188,0.4);
    padding: px2rem(20px);
    margin: 0 auto;
    margin-top: px2rem(30px);
    color: #444;
    font-size: px2rem(28px);
    div {
      padding: px2rem(20px) 0;
    }
  }
</style>
